home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1432.dms / var1432.adf / NDUK-V40.lha / V40 / include / exec / semaphores.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  1KB  |  72 lines

  1. #ifndef    EXEC_SEMAPHORES_H
  2. #define    EXEC_SEMAPHORES_H
  3. /*
  4. **    $VER: semaphores.h 39.1 (7.2.92)
  5. **    Includes Release 40.15
  6. **
  7. **    Definitions for locking functions.
  8. **
  9. **    (C) Copyright 1986-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_NODES_H
  14. #include "exec/nodes.h"
  15. #endif /* EXEC_NODES_H */
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include "exec/lists.h"
  19. #endif /* EXEC_LISTS_H */
  20.  
  21. #ifndef EXEC_PORTS_H
  22. #include "exec/ports.h"
  23. #endif /* EXEC_PORTS_H */
  24.  
  25. #ifndef EXEC_TASKS_H
  26. #include "exec/tasks.h"
  27. #endif /* EXEC_TASKS_H */
  28.  
  29.  
  30. /****** SignalSemaphore *********************************************/
  31.  
  32. /* Private structure used by ObtainSemaphore() */
  33. struct SemaphoreRequest
  34. {
  35. struct    MinNode    sr_Link;
  36. struct    Task    *sr_Waiter;
  37. };
  38.  
  39. /* Signal Semaphore data structure */
  40. struct SignalSemaphore
  41. {
  42. struct    Node            ss_Link;
  43.     WORD            ss_NestCount;
  44. struct    MinList            ss_WaitQueue;
  45. struct    SemaphoreRequest    ss_MultipleLink;
  46. struct    Task            *ss_Owner;
  47.     WORD            ss_QueueCount;
  48. };
  49.  
  50. /****** Semaphore procure message (for use in V39 Procure/Vacate ****/
  51. struct SemaphoreMessage
  52. {
  53. struct    Message        ssm_Message;
  54. struct    SignalSemaphore    *ssm_Semaphore;
  55. };
  56.  
  57. #define    SM_SHARED    (1L)
  58. #define    SM_EXCLUSIVE    (0L)
  59.  
  60. /****** Semaphore (Old Procure/Vacate type, not reliable) ***********/
  61.  
  62. struct Semaphore    /* Do not use these semaphores! */
  63. {
  64. struct    MsgPort    sm_MsgPort;
  65.     WORD    sm_Bids;
  66. };
  67.  
  68. #define sm_LockMsg    mp_SigTask
  69.  
  70.  
  71. #endif    /* EXEC_SEMAPHORES_H */
  72.